# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=libevdevplus
pkgver=0.1.1
pkgrel=0
pkgdesc="Wrapepr around evdev"
options="!check" # Requires an input device
url="https://github.com/YukiWorkshop/libevdevPlus"
arch="all"
license="MIT"
depends_dev="linux-headers"
makedepends="cmake $depends_dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/YukiWorkshop/libevdevPlus/archive/v$pkgver.tar.gz
	time64.patch
	"
builddir="$srcdir/libevdevPlus-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/*.a
}

sha512sums="03e046bdd5ea985fb638e4cfa3c32bd4a50812203d563f5989bbaa817a9fe79472a314fe9307c9b9832f666ecfd4823b91c5dc6413ffae4432105e8d198d42d9  libevdevplus-0.1.1.tar.gz
74a9438bb5945bc217004d7493202103c8daca0406a386fe5bb28f118872d6deac61d2b463aa5256f4befb8e4ff15d9185917977dcf3ba89f7cf460a2ced5b21  time64.patch"
